<script setup>
const emits = defineEmits([
  "getWeb",
  "userAdd"])

    emits("getWeb",{name:"lcj",url:"www.B.com"})

    const add = () => {
        //发送名为 user 的自定义事件
        emits("userAdd", 10)
    }
</script>

<template>
<hr style=" height:2px;border:none;border-top:2px dotted black;" /> 
<h3>子组件</h3>
<button @click="add">添加用户</button>
</template>
  